package main

import (
	"fmt"
	"sync"
	"time"
)

var lock  sync.Mutex

func testdefer(){
	lock.Lock()
	defer lock.Unlock()
}

func main() {
	time1 := time.Now()
	for i := 0; i < 10000; i++ {
		testdefer()
	}
	time2 := time.Since(time1)

	fmt.Println("time2 ", time2)

}